package Java;

import java.util.Scanner;

public class test20 {

    //    定义三个有参数有返回值方法，分别实现计算三角形、正方形、长方形的面积。
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("长方形的长：");
        double h = scanner.nextDouble();
        System.out.println("长方形的宽：");
        double a = scanner.nextDouble();

    }
    public static double chanfgangxing(double a,double h) {
        double S = a * h;
        return  S;
    }
    public static double zhengfangxing(double a) {
        double S = a*a ;
        return  S;
    }

    public static double sanjiapxing(double a,double h) {
        double S = 1 / 2 * a * h;
        return  S;
    }


}
